import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.StringTokenizer;
import java.util.*;

public class Alphabetizer {
	
	ArrayList<String> circularShiftedArrList;
	
	public Alphabetizer(CircularShift cs)
	{
		circularShiftedArrList = cs.getList();
		
	}

	//Class level variables 
	private static String NOISE_WORDS="about,after,all,also,an,and,another,any,are,as,at,be,because,been,before," +
									  "being,between,both,but,by,came,can,come,could,did,do,each,for,from,get," +
									  "got,has,had,he,have,her,here,him,himself,his,how,if,in,into,is,it,like," +
									  "make,many,me,might,more,most,much,must,my,never,now,of,on,only,or,other," +
									  "our,out,over,said,same,see,should,since,some,still,such,take,than,that," +
									  "the,their,them,then,there,these,they,this,those,through,to,too,under,up," +
									  "very,was,way,we,well,were,what,where,which,while,who,with,would,you,your,a," +
									  "b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$,1,2,3,4,5,6,7,8,9,0,_";
	
	//methods
	public ArrayList<String> Alphabetize()
	{
		Collections.sort(circularShiftedArrList);
		return RemoveNoiseWords(circularShiftedArrList);
	}
	
	
	public ArrayList<String> RemoveNoiseWords(ArrayList<String> alphabetizedArrList)
	{
		String[] strNoiseArr=NOISE_WORDS.split(",");
		List<String> noiseWordsArrList= Arrays.asList(strNoiseArr);
		StringTokenizer st;
		String sentence;
		for(int i=0;i<alphabetizedArrList.size(); i++){
			sentence=alphabetizedArrList.get(i);
			st=new StringTokenizer(sentence.toLowerCase());
			if(noiseWordsArrList.contains(st.nextElement())== true){
				alphabetizedArrList.remove(sentence);
			}
		}
		return alphabetizedArrList;
		
	}
	
	
	
}
